package cn.kgc.controller;

import cn.kgc.entity.Books;
import cn.kgc.service.BooksService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 东海龙王
 * @version 1.0
 * @date 2023/3/3 - 8:44
 */
@Controller
public class BooksController {
    @Resource
    BooksService booksService;

    @RequestMapping("/index")
    public String index(Model model){
        List<Books> allBokks = booksService.getAllBokks();
        System.out.println("=============="+allBokks);
        model.addAttribute("bok",allBokks);
        return "index";
    }
}
